docs(combobox): a11y migration analysis docs - #6618
Conversation
|
📚 Branch Preview Links🔍 Gen1 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
Coverage Report for CI Build 31738073455Warning No base build found for commit Coverage: 96.241%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
5t3ph
left a comment
There was a problem hiding this comment.
Great work pulling all of this together! There does seem to be a key assumption that still needs tested, or if it already has then these docs need updated with that info.
| - `aria-activedescendant` (input → active option): **cross-root element reference**. The active option is a light-DOM `swc-option` (projected into the shadow listbox but still rooted in the document), so this uses the ARIA element-reflection property **`ariaActiveDescendantElement`** = `activeOptionElement` (single element; note the singular property name), which resolves across the shadow boundary — the "light DOM siblings via properties" half of the hybrid model in the [web-component form-strategy demos](https://nikkimk.github.io/web-component-form-strategy-demos/demo-hybrid.html). | ||
| - Where the listbox or an option needs a name from an element it does not own, use the same element-reference pattern (`ariaLabelledByElements`) rather than an IDREF string. | ||
|
|
||
| **Verification required — does `ariaActiveDescendantElement` resolve to a slotted option?** This is the load-bearing assumption of the whole structure and must be proven before the API freezes, not assumed. The reference points from the combobox `<input>` (inside `swc-combobox`'s shadow root) to a `swc-option` that lives in the combobox's light DOM and is *projected by slot* into the shadow `swc-listbox` — and, when grouped, projected through a `swc-option-group` as well. Two things have to hold: (1) the element reference is **valid to set** — referencing outward from a shadow root to an element in a shadow-including ancestor tree is permitted by ARIA element reflection, so this is expected to be allowed; and (2) assistive technology actually **honors** the `aria-activedescendant` when the option is related to the focused input only through `aria-controls` → listbox and slot projection, rather than being a light-DOM descendant of the input. The second point is the risk, because AT resolution of "active descendant" across slot projection — especially with the **extra option-group nesting level** — is not uniformly guaranteed. Test this specific topology (option directly in the combobox, and option inside an `swc-option-group`) in NVDA, JAWS, and VoiceOver across Chromium, WebKit, and Firefox before relying on it; if an AT/browser combination does not follow the projection, fall back for that case (for example an `aria-owns` relationship establishing the listbox→option ownership in the flattened tree, or a documented limitation) rather than silently shipping a broken reference. Capture the result in this doc when known. |
There was a problem hiding this comment.
This is pretty important verification since it's assumptions that listbox and option depend on, especially since swc-option explicitly states it exists for role ownership . Do you think it's worth a spike/extra demo to verify this ahead of time, including the nested case?
Description
Adds accessibility migration analyses for the 2nd-gen combobox family — a combobox plus the shared listbox and the two option-child components it composes. The combobox and picker share one
swc-listbox, and options/option-groups can be children of a listbox, combobox, or picker.combobox/accessibility-migration-analysis.mdswc-combobox— singlecomboboxrole on the inner<input>,aria-expanded/aria-controls/aria-activedescendant/aria-autocomplete, keepingaria-selected(chosen value) distinct from the active descendant (keyboard-active row)swc-listboxrendered in the combobox shadow DOM withswc-option/swc-option-groupchildren projected into it by slot;aria-controls(input→listbox) is same-root, onlyaria-activedescendant(input→light-DOM option) is cross-root viaariaActiveDescendantElementariaActiveDescendantElementresolves to a slotted option — directly and when nested inside answc-option-group— across NVDA/JAWS/VoiceOver and Chromium/WebKit/Firefox, with a documented fallback if any combo does not honor slot projectionvalueand distinct-sibling-label rule with a dev warning (value decoupled from label); folded in consumer-reported 1st-gen limitations (key/text separation, popup width/reflow, placeholder) as design motivationlistbox/accessibility-migration-analysis.md(new componentswc-listbox)role="listbox"owned on the host viaElementInternals, factored out so combobox and picker share one listbox and it can also be used standalone (APG listbox pattern)aria-multiselectable,LiveSelectionController); slotted option projection without re-renderingoption/accessibility-migration-analysis.md(new componentswc-option)role="option"owned on the host viaElementInternals— enabling the cross-root active-descendant reference and preserving per-optionlang(fixes SWC-2359)swc-menu-item(option vs. menuitem);valuedecoupled from label and unique per widget;aria-disabledover nativedisabled; distinct-sibling-label rule + dev warning; parent may be a listbox, combobox, or pickeroption-group/accessibility-migration-analysis.md(new componentswc-option-group)role="group"owned on the host, group naming, and the APG grouped-listbox pattern; sibling-label distinctness scoped within a group; never selectable/focusable/active; no nested groups; flagged as the extra-nesting case for the active-descendant verificationRegistered all four docs in
03_components/README.mdand regenerated navigation.Motivation and context
The 2nd-gen migration is an opportunity to address known accessibility gaps, align with the latest WAI-ARIA Authoring Practices, and ensure the components meet WCAG 2.2 AA compliance. Owning
role="option"/role="group"/role="listbox"on dedicated components (instead of borrowingsp-menu/sp-menu-item) is what lets the combobox and picker share one listbox and reference real author elements across shadow roots — removing 1st-gen's duplicate-render hack and its defects.Related issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
ariaActiveDescendantElementslotted-option verification itemvalue/ distinct-sibling-label rule and dev warning covered